---@class Battle.VirtualServer
local VirtualServer = Battle.CreateClass("VirtualServer")
Battle.VirtualServer = VirtualServer
local this = VirtualServer
function VirtualServer.OnCreate()
    this.monsterList = {}
    this.playerList = {}
    this.unCreateMonsterList = {}
    this.unCreatePlayerList = {}
    this.delayTime = 1
    --Battle.ClientBattle:RegisterLateUpdateCallback(this.LateUpdate)
end
function VirtualServer.OnDestroy()
end
function VirtualServer.GetUniqueId()
    return Battle.IDGenerator.GetId()
end
function VirtualServer.LateUpdate(dt)
    this.delayTime = this.delayTime - dt
    if this.delayTime <= 0 then

    end

end

function VirtualServer.GetRandomPosInRect(lbx,lby,rtx,rty)
    local x = math.random(lbx,rtx)
    local y = math.random(lby,rty)
    return x,y
end

function VirtualServer.Send_CreatePlayer(msg)
    Battle.BattleMsgHandler.Receive_CreatePlayer(msg)
end
function VirtualServer.Receive_UseCard(id,posX,posY)
    local m = {
        id = this.GetUniqueId(),
        modelId = id,
        actorType = Battle.ActorType.Hero,
        x = posX,
        y = posY,
        dirX = -1,
        dirY = 0,
        dirZ = 0,
        camp = Battle.CampType.Blue,
    }
    this.Send_CreatePlayer(m)
end
